package com.inyaa.web.blog.controller;

import com.inyaa.base.bean.BaseResult;
import com.inyaa.web.feign.InyaaAdminFeignService;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/blog")
@RequiredArgsConstructor
public class InyaaBlogController {

    private final InyaaAdminFeignService inyaaAdminFeignService;

    @GetMapping("/list")
    public BaseResult<Page<Object>> list(Boolean isHot) {
        return inyaaAdminFeignService.findBlogList(true, isHot);
    }

    @GetMapping("/archive")
    public BaseResult<List<Object>> archive() {
        return inyaaAdminFeignService.archive();
    }

    @GetMapping("/info")
    public BaseResult<Object> list(Integer id) {
        return inyaaAdminFeignService.info(id);
    }
}
